# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime

from django.db import models

from DjangoUeditor.models import UEditorField
# Create your models here.

class Blog(models.Model):
    blog_title = models.CharField(max_length=30, verbose_name=u'博客标题')
    blog_desc = models.CharField(max_length=100, verbose_name=u'博客简介')
    blog_author = models.CharField(max_length=10, verbose_name=u'博客作者')
    blog_tag = models.CharField(max_length=10, verbose_name=u'博客分类')
    blog_create_time = models.DateTimeField(default=datetime.now, verbose_name=u'博客创建时间')
    blog_content = UEditorField(width=900, height=600, imagePath="article/ueditor/",
                                filePath="article/ueditor/",verbose_name=u"文章内容")

    class Meta:
        verbose_name = u'博客'
        verbose_name_plural = verbose_name

    def __unicode__(self):
        return self.blog_title
